/*
Mahzarin Banaji	
Proposal Title: Do Americans Think Surgeon = Male in 2019?


HYPOTHESES

Stated-Hyp1: The gender of the child affects the response to the surgeon puzzle.

	Test-Hyp1: Rates of correct answer will vary between son and daughter.
	Test-Hyp2: Rates of correct answer will vary between son and unspecified gender.
	Test-Hyp3: Rates of correct answer will vary between daughter and unspecified gender.

***********************
NOTES:
- discussed coding strategy for outcome in meeting on 3-8-2021. Agreed to code 
the qualitative answers.	
*/

clear all
use "BanajiS39.dta", clear

********************************************************************************

* INDICATORS OF EXPERIMENTAL MANIPULATIONS

* child gender
	tab P_CONDITION
	// see quex for coding
	lab def child 1 "1. son" 2 "2. daughter" 3 "3. unspecified"
	gen childgender= P_CONDITION
	lab val childgender child
	tab childgender
	
* OUTCOME MEASURES
	tab B1

	* the outcome is qualitative, but we can easily extract the relevant words 
	
	/* note: look at the original responses - the following code classifies most responses correctly*/
	gen correct = 1 if regexm(B1, "mom")
	replace correct = 1 if regexm(B1, "Mom")
	replace correct = 1 if regexm(B1, "Mother")
	replace correct = 1 if regexm(B1, "mother")
	replace correct = 1 if regexm(B1, "Woman")
	replace correct = 1 if regexm(B1, "woman")
	replace correct = 1 if regexm(B1, "Women")
	replace correct = 1 if regexm(B1, "women")	
	replace correct = 1 if regexm(B1, "MOM")	
	replace correct = 1 if regexm(B1, "WOMAN")	
	replace correct = 1 if regexm(B1, "MOTHER")	
	replace correct = 1 if regexm(B1, "Wife")
	replace correct = 1 if regexm(B1, "wife")
	replace correct = 1 if regexm(B1, "WIFE")
 	tab B1 if correct!=1
	replace correct=0 if B1!=" " & correct!=1
	tab correct

	
********************************************************************************

* ANALYSIS
	
*Test-Hyp1: Rates of correct answer will vary between son and daughter.
	reg correct i.childgender if childgender!=3
	// reject. 0.177

	tess 2.childgender, init(BanajiS39) 
	
*Test-Hyp2: Rates of correct answer will vary between son and unspecified gender.
	reg correct i.childgender if childgender!=2
	// do not reject. 0.000

	tess 3.childgender
	
	
*Test-Hyp3: Rates of correct answer will vary between daughter and unspecified gender.
	reg correct i.childgender if childgender!=1
	// do not reject. 0.000

	tess 3.childgender
	